package Service.impl;
import Mapper.VirtualProductMapper;
import Service.VirtualProductService;
import pojo.VirtualProduct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VirtualProductServiceImpl implements VirtualProductService {
    @Autowired
    private VirtualProductMapper mapper;

    public List<VirtualProduct> findAll() {
        return mapper.findAll();
    }

    public List<VirtualProduct> findByCategory(Long cid) {
        return mapper.findByCategory(cid);
    }

    public VirtualProduct findById(Long id) {
        return mapper.findById(id);
    }

    public void reduceStock(Long id, int quantity) {
        mapper.reduceStock(id, quantity);
    }
}
